using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using Sedna.Core.AppConfig;
using Sedna.Core.Common.Objects.Navigation;
using Sedna.Core.Controller;
using Sedna.Core.Controller.Common;

namespace Sedna.Core.pages.Actions
{
    public class LoginLoadAction: AbstractAction
    {
        public String exceptionCodePath;

        public string ExceptionCodePath
        {
            set { exceptionCodePath = value; }
        }

        public override IActionResult Execute(IExecutionContext executionContext)
        {
            string value = AppConfigurationHolder.BuildNumber();
            scopePathParser.Parse("ec['hsbc.build.visible']").Value = (value != null && value != string.Empty)? true: false;
            value = string.Format("Build: {0}", value);
            scopePathParser.Parse("ec['hsbc.build']").Value = value;
            object exceptionCode = scopePathParser.Parse(exceptionCodePath).Value;
            if (exceptionCode == null)
            {
                executionContext.SetPropertyValue(exceptionCodePath, 0);
                scopePathParser.Parse("ec['errorlabel2.visible']").Value = false;
            }

            return CreateResult(successStatus);
        }
    }
}
